import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    ruleForm: {},
    matchrole: [],

  },

  mutations: {
    setruleform(state, ruleform) {
      state.ruleform = ruleform;
    },
    clearruleform(state) {
      state.ruleform = {
        name: "",
        cellphone: "",
        position: "",
        level: "",
        area_name: "",
        unit_type: "",
        remark: "",
        disabled: "启用"
      };
    },
    set_matchrole(state, matchrole) {
      state.matchrole = matchrole
    },
    get_matchrole(state) {
      return state.matchrole

    }
  },
  actions: {
    actions_get_matchrole(context, matchrole) {
      context.dispatch('get_matchrole')
    },
    actions_set_matchrole(context, matchrole) {
      context.commit('set_matchrole', matchrole)
    }

  }
})